import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { LayoutsComponent } from './layouts';
import { LoginComponent } from './auth/login.component';
const routes: Routes = [
    {
        path: '',
        redirectTo: 'ccm',
        pathMatch: 'full'
    },
    {
        path: 'ccm',
        component: LayoutsComponent,
        children: [
            { path: '', redirectTo: 'data-visualization', pathMatch: 'full' },
            { path: 'home', loadChildren: './pages/home/home.module#HomeModule' },
            { path: 'data-visualization', loadChildren: './pages/data-visualization/data-visualization.module#DataVisualizationModule' },

            {
                path: 'dissemination-management',
                loadChildren: './pages/dissemination-management/dissemination-management.module#DisseminationManagementModule'
            },
            { path: 'traffic-management', loadChildren: './pages/traffic-management/traffic-management.module#TrafficManagementModule' },
            {
                path: 'equipment-management',
                loadChildren: './pages/equipment-management/equipment-management.module#EquipmentManagementModule'
            },
            {
                path: 'security-management',
                loadChildren: './pages/security-management/security-management.module#SecurityManagementModule'
            },
            { path: 'data-management', loadChildren: './pages/data-management/data-management.module#DataManagementModule' },
            { path: 'user-management', loadChildren: './pages/user-management/user-management.module#UserManagementModule' },
            { path: 'log-management', loadChildren: './pages/log-management/log-management.module#LogManagementModule' }
        ]
    },
    { path: 'gis', loadChildren: './pages/gis/gis.module#GisModule', data: { title: 'GIS' } },
    { path: 'login', component: LoginComponent },
    { path: '**', redirectTo: 'ccm/data-visualization', pathMatch: 'full' }
];

@NgModule({
    imports: [RouterModule.forRoot(routes, { useHash: true })],
    exports: [RouterModule]
})
export class AppRoutingModule {}
